<template>
    <div class="child">
        <h2>我是子组件1</h2>
        <h3>电脑：{{ computer }}</h3>
        <button @click="emitter.emit('sendComputer',computer)">点击传送数据</button>
    </div>
</template>
<script setup lang="ts">
import emitter from '@/utils/emitter';
    import {ref} from 'vue'
    let computer=ref('联想小新')

</script>
<style lang="css" scoped>
     .child{
        width: 700px;
        height:150px;
        padding:10px;
        background-color: antiquewhite;
        margin-top: 15px;
   }
</style>